package com.bite.book.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RequestMapping("/test")
@RestController
public class TestController {

    @RequestMapping("/t1")
    public String t1(){
//        int a = 10/0;
        log.info("执行T1方法");
        return "t1";
    }

    @RequestMapping("/t2")
    public int t2(){
        String aa = "abcdef";
        log.info("执行T2方法");
        return aa.length();
    }

    @RequestMapping("/t3")
    public int t3(){
        int[] a = {1,2,3};
        int val = a[4];
        log.info("执行T3方法");
        return val;
    }

}
